/**
 * 
 */
package cn.ivicar.sim.service;

import java.util.List;

import com.google.inject.Inject;

import cn.com.carsmart.ws.model.AppPay;
import cn.com.carsmart.ws.service.AppPayManager;

/**
 * @author liurunbin 2017年7月7日 cn.ivicar.sim.service
 */
public class AppPayService {

	@Inject
	private AppPayManager appPayManager;

	public AppPay getByAppIdAndType(String appId, Integer payType) {
		AppPay query = new AppPay();
		query.setAppId(appId);
		query.setPayType(payType);
		List<AppPay> list = appPayManager.listByExample(query);
		if (list == null || list.isEmpty()) {
			return null;
		}
		return list.get(0);
	}
	
	public AppPay getByPayAppIdAndType(String payAppId, Integer payType) {
		AppPay query = new AppPay();
		query.setPayAppId(payAppId);
		query.setPayType(payType);
		List<AppPay> list = appPayManager.listByExample(query);
		if (list == null || list.isEmpty()) {
			return null;
		}
		return list.get(0);
	}
}
